<include file="../Public/_header" />
<div class="so_main">
  <div class="page_tit">用户认证</div>
  <div class="tit_tab">
    <ul>
	  <li><a href="{:U('admin/User/verified', array('verified'=>'0'))}">待认证</a></li>
	  <li><a href="{:U('admin/User/verified', array('verified'=>'1'))}">已认证</a></li>
	  <li><a href="<if condition="$verified['uid']">javascript:;<else />{:U('admin/User/addVerifiedUser')}</if>" class="on"
	  	><if condition="$verified['id']">编辑<else />添加</if>认证</a></li>
    </ul>
  </div>

  <form method="post" action="{:U('admin/User/saveVerified')}" onsubmit="return modifyVerified(this);">
  <div class="form2">
    <dl class="lineD">
      <dt>用户ID：<span class="cRed pr5">*</span></dt>
      <dd>
        <input name="uid" id="uid" type="text" value="{$verified.uid}">
      </dd>
    </dl>

    <dl class="lineD">
      <dt>真实姓名：</dt>
      <dd>
        <input name="realname" id="realname" type="text" value="{$verified.realname}">
    </dl>

    <dl class="lineD">
      <dt>手机号：</dt>
      <dd>
        <input name="phone" id="phone" type="text" value="{$verified.phone}">
      </dd>
    </dl>

    <dl class="lineD">
      <dt>认证原因：</dt>
      <dd>
        <textarea name="reason" id="reason" cols="40" rows="3">{$verified.reason}</textarea>
      </dd>
    </dl>

    <dl class="lineD">
      <dt>认证资料：<span class="cRed pr5">*</span></dt>
      <dd>
        <textarea name="info" id="info" cols="40" rows="3">{$verified.info}</textarea>
      </dd>
    </dl>

    <dl class="lineD">
      <dt>是否通过：<span class="cRed pr5">*</span></dt>
      <dd>
        <label><input name="verified" type="radio" value="1" checked>是</label>
        <label><input name="verified" type="radio" value="0">否</label>
    </dl>
	
    <div class="page_btm">
      <if condition="$verified['id']">
      	<input name="id" type="hidden" value="{$verified['id']}" />
      </if>
      <if condition="$jumpUrl">
      	<input name="jumpUrl" type="hidden" value="{$jumpUrl}" />
      </if>
      <input type="submit" class="btn_b" value="确定" />
    </div>
  </div>
  </form>
</div>
<script>
function modifyVerified(o)
{
	if (!o.uid.value.match(/^[\d]+$/)) {
		ui.error('请选择用户');
		o.uid.focus();
		return false;
	} else if (o.realname.value && !o.realname.value.match(/^[\u4e00-\u9fa5]+$|^[a-zA-Z\.·]+$/)) {
		ui.error('请输入真实姓名');
		o.realname.focus();
		return false;
	} else if (o.phone.value && !o.phone.value.match(/^[\d]{11}$/)) {
		ui.error('请输入手机号');
		o.phone.focus();
		return false;
	} else if (o.info.value.length <= 0) {
		ui.error('请输入认证资料');
		o.info.focus();
		return false;
	}
}
</script>
<include file="../Public/_footer" />